//
//  HomeBottomView.swift
//  weiboLQ
//
//  Created by 半缘君 on 15/12/12.
//  Copyright © 2015年 banyuanjun.cn. All rights reserved.
//

import UIKit

class HomeBottomView: UIView {
// MARK: - 懒加载控件
    lazy var retweetBtn:UIButton = UIButton(title: "转发", image: "timeline_icon_retweet")
    lazy var commentBtn:UIButton = UIButton(title: "评论", image: "timeline_icon_comment")
    lazy var likeBtn:UIButton = UIButton(title: "赞", image: "timeline_icon_unlike")
//MARK: - 构造方法
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
// MARK: - 添加控件
extension HomeBottomView{
/// 更新UI
    private func setupUI () {
        addRetweetBtn()
        addCommentBtn()
        addLikeBtn()
    }
/// 评论按钮
    private func addCommentBtn () {
        addSubview(commentBtn)
        commentBtn.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(retweetBtn)
            make.left.equalTo(retweetBtn.snp_right)
            make.height.equalTo(retweetBtn)
            make.width.equalTo(retweetBtn)
        }
    }
/// 转发按钮
    private func addRetweetBtn () {
        addSubview(retweetBtn)

        retweetBtn.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(self)//.offset(LQHomeCellMargin)
            make.left.equalTo(self)//.offset(LQHomeCellMargin)
            make.height.equalTo(self)
        }
    }
/// 赞按钮
    private func addLikeBtn () {
        addSubview(likeBtn)
        likeBtn.snp_makeConstraints { (make) -> Void in
            make.top.equalTo(commentBtn)
            make.left.equalTo(commentBtn.snp_right)
            make.height.equalTo(commentBtn)
            make.width.equalTo(commentBtn)
            make.right.equalTo(self)
            
        }
    }
}